Skip to content

Enforce the peak lint tier and fix its findings - #19

Merged
sudo-py-dev merged 3 commits into
mainfrom
peak-lints
Nov 13, 2026
Merged

sudo-py-dev merged 3 commits into
mainfrom
peak-lints

Conversation

@sudo-py-dev

@sudo-py-dev sudo-py-dev commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

What

Clippy now treats every lint group as an error: correctness, suspicious, perf, complexity, style and pedantic. It also adds about 45 lints chosen because they catch likely bugs, plus strict compiler lints. The audit's lint_policy lists the key ones, so cargo test fails if one is removed from Cargo.toml.

New lints include:

  • wildcard_enum_match_arm: a new variant can't land silently in _ =>
  • map_err_ignore: no |_| that throws away the cause
  • significant_drop_in_scrutinee: a lock guard held across a match
  • iter_over_hash_type: output that depends on hash order
  • clone_on_ref_ptr: x.clone() hiding that only an Arc/Rc pointer is copied
  • multiple_unsafe_ops_per_block, collection_is_never_read, read_zero_byte_vec
  • compiler lints trivial_casts, unused_qualifications, elided_lifetimes_in_paths, missing_debug_implementations

Six pedantic lints that are taste rather than bugs are opted out on purpose. indexing_slicing and arithmetic_side_effects are still not on crate-wide: in the parsers they produce about 1,200 findings, so they will be added one module at a time.

Fixes

  • Indirect-block maps (ext) and Windows disk rows now use BTreeMap, so results no longer depend on hash order.
  • Matches on CandidateEnd, Validation, Inspection, Destination and the XML and Markdown events list every variant.
  • Parsers drop error detail through one named CandidateEnd::malformed helper instead of |_| at each site. App-level errors keep their cause.
  • Functions that could never fail no longer return Result or Option.
  • Generated Slint code, platform stubs and a few deliberate cases carry scoped #[expect(lint, reason = ...)].
  • One Clippy suggestion was wrong and was not applied. It would have removed the collect() that makes sure every thread starts before any join behind the barrier in tests/security.rs, which deadlocks.
  • The audit skips the git-ignored .claude/ folder, which can hold other sessions' worktrees of this repository.

This branch also includes the earlier move of app-level errors (updater, installer, processes) to anyhow, which was already in the working tree.

Verified locally

  • cargo fmt --all -- --check
  • cargo test --locked: all suites pass, including the audit and the headless UI renders
  • cargo clippy --locked --all-targets -- -D warnings
  • cargo clippy --locked --target x86_64-pc-windows-gnu --all-targets -- -D warnings

macOS was not built locally.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of file-system allocation data and malformed file-format input.
    • Error messages now retain more diagnostic detail across previews, updates, and system operations.
  • Refactor
    • Standardized error reporting and strengthened code-quality checks.
  • Documentation
    • Clarified development linting guidance and added instructions for checking Windows-specific code.

Turn every Clippy group (including pedantic) to deny, add the nursery
and restriction lints that catch likely bugs (unhandled enum variants,
discarded error causes, guards held across a match, hash-order
dependence, hidden Arc/Rc clones, multi-op unsafe blocks) and strict
rustc lints. The audit's lint policy now requires the key ones, so they
cannot be dropped silently.

Fixes the lints found:
- Indirect-block maps and Windows disk rows use BTreeMap, so results no
  longer depend on hash order.
- Matches list every variant; parsers drop error detail through one
  named CandidateEnd::malformed helper instead of |_| at each site.
- Functions that could not fail no longer return Result or Option.
- Generated Slint code and platform stubs carry scoped #[expect]s with
  reasons.

The audit skips the git-ignored .claude folder, which can hold other
sessions' worktrees of this repository.

Also includes the move of app-level errors (updater, installer,
processes) to anyhow that was already in the working tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
reclaim Ignored Ignored Preview Nov 13, 2026 1:31pm UTC

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 234d20e8-b1b9-41b2-8f3e-c9d43bcbcf24
Commits

Reviewing files that changed from the base of the PR and between ef91551 and 175038b.

Files ignored due to path filters: 1

  • fuzz/Cargo.lock is excluded by !**/*.lock
Files selected for processing: 4

  • src/drives/macos.rs
  • src/installer.rs
  • src/update_runtime.rs
  • src/updater.rs

No actionable comments were generated in the recent review.

Walkthrough

The pull request adds a Clippy lint policy and audit checks, changes error-return APIs to use anyhow, and updates scanning, format parsing, drive handling, application integration, and related tests.

Changes: Core changes

Layer / File(s) Summary
Lint policy and audit support
Cargo.toml, docs/DEVELOPMENT.md, tests/audit/*
Cargo lint settings and development guidance define denied lint groups, selected exceptions, and Windows-target checks. Audit code checks additional lints and updates its visibility and reporting helpers.
Error propagation and diagnostics
src/diagnostics.rs, src/i18n.rs, src/installer.rs, src/native_process.rs, src/preview.rs, src/update_runtime.rs, src/updater.rs, src/updates.rs
Installer, process, preview, and update APIs use anyhow::Result. Error values propagate with context, and display and update-message code handles the updated error types.
Allocation and format scanning
src/allocation*, src/detection.rs, src/formats*, src/ntfs.rs, src/zip.rs, src/lib.rs, src/allocation/tests.rs, tests/expanded_formats.rs, tests/large_zip.rs, tests/new_formats.rs
Allocation and format parsing update integer conversions, name handling, map ordering, and malformed-input mapping. Related scanning and format tests update their assertions.
Drive, source, and application integration
src/drives*, src/source.rs, src/resilient.rs, src/main.rs, src/slint_ui_tests.rs, src/ui_text.rs, src/recovery_tests.rs, tests/security.rs
Drive and source handling, application callbacks, and UI model updates receive implementation changes. Related tests update shared-pointer cloning, lifetimes, dimensions, and error assertions.

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Other

Merge Risk: Minimal · previous review ef915

This change tightens lint enforcement and applies mostly behavior-preserving refactors, including a move of app-level errors to anyhow. No concrete merge-blocking risk was identified, and the author reports that local checks passed.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Enforce the peak lint tier and fix its findings" matches the main change. The PR configures Clippy to deny the correctness, suspicious, perf, complexity, style, and pedantic groups, and it …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Enforce the peak lint tier and fix its findings" matches the main change. The PR configures Clippy to deny the correctness, suspicious, perf, complexity, style, and pedantic groups, and it fixes the resulting findings across many source files. The title is short, specific, and states the primary intent. It does not name the anyhow migration, but the PR objectives describe that as a secondary change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 763d8b81-58e5-4f76-9dcf-95ea1d083d99
Commits

Reviewing files that changed from the base of the PR and between 74736ee and ef91551.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 46

  • Cargo.toml
  • docs/DEVELOPMENT.md
  • src/allocation.rs
  • src/allocation/directory.rs
  • src/allocation/ext.rs
  • src/allocation/fat.rs
  • src/allocation/indirect.rs
  • src/allocation/journal.rs
  • src/allocation/ntfs.rs
  • src/allocation/tests.rs
  • src/detection.rs
  • src/diagnostics.rs
  • src/drives.rs
  • src/drives/linux.rs
  • src/drives/monitor.rs
  • src/drives/windows.rs
  • src/formats.rs
  • src/formats/cfb.rs
  • src/formats/gzip.rs
  • src/formats/xar.rs
  • src/i18n.rs
  • src/installer.rs
  • src/lib.rs
  • src/main.rs
  • src/native_process.rs
  • src/ntfs.rs
  • src/preview.rs
  • src/recovery_tests.rs
  • src/resilient.rs
  • src/slint_ui_tests.rs
  • src/source.rs
  • src/ui_text.rs
  • src/update_runtime.rs
  • src/updater.rs
  • src/updates.rs
  • src/validation.rs
  • src/zip.rs
  • tests/audit/main.rs
  • tests/audit/rules.rs
  • tests/audit/supply_chain.rs
  • tests/audit/translations.rs
  • tests/audit/workspace.rs
  • tests/expanded_formats.rs
  • tests/large_zip.rs
  • tests/new_formats.rs
  • tests/security.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

sudo-py-dev and others added 2 commits November 13, 2026 15:30
The macOS build failed because macOS-only code was never linted on
Linux or Windows. A trivial `&mut x as *mut _` cast now uses
`&raw mut`, Core Foundation imports are explicit, each unsafe call has
its own block and SAFETY comment (an `is_type` helper covers the CF
type checks), and the rest are small lint fixes.

Checked with `cargo clippy --target aarch64-apple-darwin` locally.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fuzz crate depends on reclaim, which now uses anyhow, so
`cargo check --locked` for the fuzz harnesses could not resolve it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sudo-py-dev
sudo-py-dev merged commit 9c17517 into main Nov 13, 2026
9 checks passed
@sudo-py-dev
sudo-py-dev deleted the peak-lints branch November 13, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant